/*!
 * avangard/chat/chat_data.js
 * © 2009 avangardonline.ru
 * @author BlooDHounD <http://www.controller.by>
 */

if ( !window.controller ) throw new Error( '"controller" not initialized' );

controller.require( 'avangard.chat' );

if ( !avangard.chat.ChatData ) {

	controller.require( 'controller.utils.Hash' );
	controller.require( 'controller.utils.List' );

	/**
	 * @class
	 * @namespace	avangard.chat
	 * @requires	controller.utils.Hash
	 * @requires	controller.utils.List
	 * @author		BlooDHounD	<http://www.controller.by>
	 */
	avangard.chat.ChatData = ( function() {

		//--------------------------------------------------------------------------
		//
		//  Class variables
		//
		//--------------------------------------------------------------------------

		var	utils =		controller.utils;

		//--------------------------------------------------------------------------
		//
		//  Constructor
		//
		//--------------------------------------------------------------------------

		/**
		 * @constructor
		 */
		var ChatData = function() {
			this.channels =			new utils.Hash();
			this.channelHeaders =	new utils.List();
		};

		var	ChatDataPrototype = ChatData.prototype;

		//--------------------------------------------------------------------------
		//
		//  Properties
		//
		//--------------------------------------------------------------------------

		/**
		 * @property
		 * @type	{controller.utils.Hash}
		 */
		ChatDataPrototype.channels = null;

		/**
		 * @property
		 * @type	{controller.utils.List}
		 */
		ChatDataPrototype.channelHeaders = null;

		/**
		 * @property
		 * @type	{Number}
		 */
		ChatDataPrototype.characterID = 0;

		/**
		 * @property
		 * @type	{String}
		 */
		ChatDataPrototype.characterName = null;

		//--------------------------------------------------------------------------
		//
		//  Methods
		//
		//--------------------------------------------------------------------------

		/**
		 * @method
		 * @override
		 * подготавливает объект к удалению
		 */
		ChatDataPrototype.dispose = function() {
			this.channels.dispose();
			this.channelHeaders.dispose();
		};

		/**
		 * @method
		 * @return	{String}
		 */
		ChatDataPrototype.toString = function() {
			return '[ChatData object]';
		};

		//--------------------------------------------------------------------------
		//
		//  Class methods
		//
		//--------------------------------------------------------------------------

		/**
		 * @static
		 * @method
		 * @return	{String}
		 */
		ChatData.toString = function() {
			return '[class ChatData]';
		};

		return ChatData;

	}() );

}